package reticulado;

public class EjeW extends Eje {

    public EjeW(AbstractNode desde, String label, AbstractNode hasta) {
        this.desde = desde;
        this.hasta = hasta;
        this.label = label;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final EjeW other = (EjeW) obj;
        if (this.desde != other.desde && (this.desde == null || !this.desde.equals(other.desde))) {
            return false;
        }
        if (this.hasta != other.hasta && (this.hasta == null || !this.hasta.equals(other.hasta))) {
            return false;
        }
        if ((this.label == null) ? (other.label != null) : !this.label.equals(other.label)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "W<" + desde.toString() + "," + label + "," + hasta.toString() + ">";
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 11 * hash + (this.desde != null ? this.desde.hashCode() : 0);
        hash = 11 * hash + (this.hasta != null ? this.hasta.hashCode() : 0);
        hash = 11 * hash + (this.label != null ? this.label.hashCode() : 0);
        return hash;
    }
}
